<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - ged.info - test/impl/unit_test_log.ipp</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../index.html">directory</a> - <a href="index.html">test/impl</a> - unit_test_log.ipp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>ged.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2009-06-09</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">137</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">46.7 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">64</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : //  (C) Copyright Gennadiy Rozental 2005-2008.
<span class="lineNum">       2 </span>                : //  Distributed under the Boost Software License, Version 1.0.
<span class="lineNum">       3 </span>                : //  (See accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       4 </span>                : //  http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       5 </span>                : 
<span class="lineNum">       6 </span>                : //  See http://www.boost.org/libs/test for the library home page.
<span class="lineNum">       7 </span>                : //
<span class="lineNum">       8 </span>                : //  File        : $RCSfile$
<span class="lineNum">       9 </span>                : //
<span class="lineNum">      10 </span>                : //  Version     : $Revision: 49312 $
<span class="lineNum">      11 </span>                : //
<span class="lineNum">      12 </span>                : //  Description : implemets Unit Test Log
<span class="lineNum">      13 </span>                : // ***************************************************************************
<span class="lineNum">      14 </span>                : 
<span class="lineNum">      15 </span>                : #ifndef BOOST_TEST_UNIT_TEST_LOG_IPP_012205GER
<span class="lineNum">      16 </span>                : #define BOOST_TEST_UNIT_TEST_LOG_IPP_012205GER
<span class="lineNum">      17 </span>                : 
<span class="lineNum">      18 </span>                : // Boost.Test
<span class="lineNum">      19 </span>                : #include &lt;boost/test/unit_test_log.hpp&gt;
<span class="lineNum">      20 </span>                : #include &lt;boost/test/unit_test_log_formatter.hpp&gt;
<span class="lineNum">      21 </span>                : #include &lt;boost/test/unit_test_suite_impl.hpp&gt;
<span class="lineNum">      22 </span>                : #include &lt;boost/test/execution_monitor.hpp&gt;
<span class="lineNum">      23 </span>                : 
<span class="lineNum">      24 </span>                : #include &lt;boost/test/detail/unit_test_parameters.hpp&gt;
<span class="lineNum">      25 </span>                : 
<span class="lineNum">      26 </span>                : #include &lt;boost/test/utils/basic_cstring/compare.hpp&gt;
<span class="lineNum">      27 </span>                : 
<span class="lineNum">      28 </span>                : #include &lt;boost/test/output/compiler_log_formatter.hpp&gt;
<span class="lineNum">      29 </span>                : #include &lt;boost/test/output/xml_log_formatter.hpp&gt;
<span class="lineNum">      30 </span>                : 
<span class="lineNum">      31 </span>                : // Boost
<span class="lineNum">      32 </span>                : #include &lt;boost/scoped_ptr.hpp&gt;
<span class="lineNum">      33 </span>                : #include &lt;boost/io/ios_state.hpp&gt;
<span class="lineNum">      34 </span>                : typedef ::boost::io::ios_base_all_saver io_saver_type;
<span class="lineNum">      35 </span>                : 
<span class="lineNum">      36 </span>                : // STL
<span class="lineNum">      37 </span>                : #include &lt;iostream&gt;
<span class="lineNum">      38 </span>                : 
<span class="lineNum">      39 </span>                : #include &lt;boost/test/detail/suppress_warnings.hpp&gt;
<span class="lineNum">      40 </span>                : 
<span class="lineNum">      41 </span>                : //____________________________________________________________________________//
<span class="lineNum">      42 </span>                : 
<span class="lineNum">      43 </span>                : namespace boost {
<span class="lineNum">      44 </span>                : 
<span class="lineNum">      45 </span>                : namespace unit_test {
<span class="lineNum">      46 </span>                : 
<span class="lineNum">      47 </span>                : // ************************************************************************** //
<span class="lineNum">      48 </span>                : // **************             entry_value_collector            ************** //
<span class="lineNum">      49 </span>                : // ************************************************************************** //
<span class="lineNum">      50 </span>                : 
<span class="lineNum">      51 </span>                : namespace ut_detail {
<span class="lineNum">      52 </span>                : 
<span class="lineNum">      53 </span>                : entry_value_collector const&amp;
<span class="lineNum">      54 </span><span class="lineNoCov">              0 : entry_value_collector::operator&lt;&lt;( lazy_ostream const&amp; v ) const</span>
<span class="lineNum">      55 </span>                : {
<span class="lineNum">      56 </span><span class="lineNoCov">              0 :     unit_test_log &lt;&lt; v;</span>
<span class="lineNum">      57 </span>                : 
<span class="lineNum">      58 </span><span class="lineNoCov">              0 :     return *this;</span>
<span class="lineNum">      59 </span>                : }
<span class="lineNum">      60 </span>                : 
<span class="lineNum">      61 </span>                : //____________________________________________________________________________//
<span class="lineNum">      62 </span>                : 
<span class="lineNum">      63 </span>                : entry_value_collector const&amp; 
<span class="lineNum">      64 </span><span class="lineNoCov">              0 : entry_value_collector::operator&lt;&lt;( const_string v ) const</span>
<span class="lineNum">      65 </span>                : {
<span class="lineNum">      66 </span><span class="lineNoCov">              0 :     unit_test_log &lt;&lt; v;</span>
<span class="lineNum">      67 </span>                : 
<span class="lineNum">      68 </span><span class="lineNoCov">              0 :     return *this;</span>
<span class="lineNum">      69 </span>                : }
<span class="lineNum">      70 </span>                : 
<span class="lineNum">      71 </span>                : //____________________________________________________________________________//
<span class="lineNum">      72 </span>                : 
<span class="lineNum">      73 </span><span class="lineNoCov">              0 : entry_value_collector::~entry_value_collector()</span>
<span class="lineNum">      74 </span>                : {
<span class="lineNum">      75 </span><span class="lineNoCov">              0 :     if( m_last )</span>
<span class="lineNum">      76 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; log::end();</span>
<span class="lineNum">      77 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">      78 </span>                : 
<span class="lineNum">      79 </span>                : //____________________________________________________________________________//
<span class="lineNum">      80 </span>                : 
<span class="lineNum">      81 </span>                : } // namespace ut_detail
<span class="lineNum">      82 </span>                : 
<span class="lineNum">      83 </span>                : // ************************************************************************** //
<span class="lineNum">      84 </span>                : // **************                 unit_test_log                ************** //
<span class="lineNum">      85 </span>                : // ************************************************************************** //
<span class="lineNum">      86 </span>                : 
<span class="lineNum">      87 </span>                : namespace {
<span class="lineNum">      88 </span>                : 
<span class="lineNum">      89 </span><span class="lineCov">              2 : struct unit_test_log_impl {</span>
<span class="lineNum">      90 </span>                :     // Constructor
<span class="lineNum">      91 </span><span class="lineCov">              2 :     unit_test_log_impl()</span>
<span class="lineNum">      92 </span>                :     : m_stream( &amp;std::cout )
<span class="lineNum">      93 </span>                :     , m_stream_state_saver( new io_saver_type( std::cout ) )
<span class="lineNum">      94 </span>                :     , m_threshold_level( log_all_errors )
<span class="lineNum">      95 </span><span class="lineCov">              2 :     , m_log_formatter( new output::compiler_log_formatter )</span>
<span class="lineNum">      96 </span>                :     {
<span class="lineNum">      97 </span><span class="lineCov">              2 :     }</span>
<span class="lineNum">      98 </span>                : 
<span class="lineNum">      99 </span>                :     // log data
<span class="lineNum">     100 </span>                :     typedef scoped_ptr&lt;unit_test_log_formatter&gt; formatter_ptr;
<span class="lineNum">     101 </span>                :     typedef scoped_ptr&lt;io_saver_type&gt;           saver_ptr;
<span class="lineNum">     102 </span>                : 
<span class="lineNum">     103 </span>                :     std::ostream*       m_stream;
<span class="lineNum">     104 </span>                :     saver_ptr           m_stream_state_saver;
<span class="lineNum">     105 </span>                :     log_level           m_threshold_level;
<span class="lineNum">     106 </span>                :     formatter_ptr       m_log_formatter;
<span class="lineNum">     107 </span>                : 
<span class="lineNum">     108 </span>                :     // entry data
<span class="lineNum">     109 </span>                :     bool                m_entry_in_progress;
<span class="lineNum">     110 </span>                :     bool                m_entry_started;
<span class="lineNum">     111 </span>                :     log_entry_data      m_entry_data;
<span class="lineNum">     112 </span>                : 
<span class="lineNum">     113 </span>                :     // check point data
<span class="lineNum">     114 </span>                :     log_checkpoint_data m_checkpoint_data;
<span class="lineNum">     115 </span>                : 
<span class="lineNum">     116 </span>                :     // helper functions
<span class="lineNum">     117 </span><span class="lineCov">              6 :     std::ostream&amp;       stream()            { return *m_stream; }</span>
<span class="lineNum">     118 </span><span class="lineCov">             14 :     void                set_checkpoint( const_string file, std::size_t line_num, const_string msg )</span>
<span class="lineNum">     119 </span>                :     {
<span class="lineNum">     120 </span><span class="lineCov">             14 :         assign_op( m_checkpoint_data.m_message, msg, 0 );</span>
<span class="lineNum">     121 </span><span class="lineCov">             14 :         m_checkpoint_data.m_file_name    = file;</span>
<span class="lineNum">     122 </span><span class="lineCov">             14 :         m_checkpoint_data.m_line_num    = line_num;</span>
<span class="lineNum">     123 </span><span class="lineCov">             14 :     }</span>
<span class="lineNum">     124 </span>                : };
<span class="lineNum">     125 </span>                : 
<span class="lineNum">     126 </span><span class="lineCov">            300 : unit_test_log_impl&amp; s_log_impl() { static unit_test_log_impl the_inst; return the_inst; }</span>
<span class="lineNum">     127 </span>                : 
<span class="lineNum">     128 </span>                : } // local namespace
<span class="lineNum">     129 </span>                : 
<span class="lineNum">     130 </span>                : //____________________________________________________________________________//
<span class="lineNum">     131 </span>                : 
<span class="lineNum">     132 </span>                : void
<span class="lineNum">     133 </span><span class="lineCov">              2 : unit_test_log_t::test_start( counter_t test_cases_amount )</span>
<span class="lineNum">     134 </span>                : {
<span class="lineNum">     135 </span><span class="lineCov">              2 :     if( s_log_impl().m_threshold_level == log_nothing )</span>
<span class="lineNum">     136 </span><span class="lineNoCov">              0 :         return;</span>
<span class="lineNum">     137 </span>                : 
<span class="lineNum">     138 </span><span class="lineCov">              2 :     s_log_impl().m_log_formatter-&gt;log_start( s_log_impl().stream(), test_cases_amount );</span>
<span class="lineNum">     139 </span>                : 
<span class="lineNum">     140 </span><span class="lineCov">              2 :     if( runtime_config::show_build_info() )</span>
<span class="lineNum">     141 </span><span class="lineNoCov">              0 :         s_log_impl().m_log_formatter-&gt;log_build_info( s_log_impl().stream() );</span>
<span class="lineNum">     142 </span>                : 
<span class="lineNum">     143 </span><span class="lineCov">              2 :     s_log_impl().m_entry_in_progress = false;</span>
<span class="lineNum">     144 </span>                : }
<span class="lineNum">     145 </span>                : 
<span class="lineNum">     146 </span>                : //____________________________________________________________________________//
<span class="lineNum">     147 </span>                : 
<span class="lineNum">     148 </span>                : void
<span class="lineNum">     149 </span><span class="lineCov">              2 : unit_test_log_t::test_finish()</span>
<span class="lineNum">     150 </span>                : {
<span class="lineNum">     151 </span><span class="lineCov">              2 :     if( s_log_impl().m_threshold_level == log_nothing )</span>
<span class="lineNum">     152 </span><span class="lineNoCov">              0 :         return;</span>
<span class="lineNum">     153 </span>                : 
<span class="lineNum">     154 </span><span class="lineCov">              2 :     s_log_impl().m_log_formatter-&gt;log_finish( s_log_impl().stream() );</span>
<span class="lineNum">     155 </span>                : 
<span class="lineNum">     156 </span><span class="lineCov">              2 :     s_log_impl().stream().flush();</span>
<span class="lineNum">     157 </span>                : }
<span class="lineNum">     158 </span>                : 
<span class="lineNum">     159 </span>                : //____________________________________________________________________________//
<span class="lineNum">     160 </span>                : 
<span class="lineNum">     161 </span>                : void
<span class="lineNum">     162 </span><span class="lineNoCov">              0 : unit_test_log_t::test_aborted()</span>
<span class="lineNum">     163 </span>                : {
<span class="lineNum">     164 </span><span class="lineNoCov">              0 :     BOOST_TEST_LOG_ENTRY( log_messages ) &lt;&lt; &quot;Test is aborted&quot;;</span>
<span class="lineNum">     165 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     166 </span>                : 
<span class="lineNum">     167 </span>                : //____________________________________________________________________________//
<span class="lineNum">     168 </span>                : 
<span class="lineNum">     169 </span>                : void
<span class="lineNum">     170 </span><span class="lineCov">             13 : unit_test_log_t::test_unit_start( test_unit const&amp; tu )</span>
<span class="lineNum">     171 </span>                : {
<span class="lineNum">     172 </span><span class="lineCov">             13 :     if( s_log_impl().m_threshold_level &gt; log_test_units )</span>
<span class="lineNum">     173 </span><span class="lineCov">             13 :         return;</span>
<span class="lineNum">     174 </span>                : 
<span class="lineNum">     175 </span><span class="lineNoCov">              0 :     if( s_log_impl().m_entry_in_progress )</span>
<span class="lineNum">     176 </span><span class="lineNoCov">              0 :         *this &lt;&lt; log::end();</span>
<span class="lineNum">     177 </span>                : 
<span class="lineNum">     178 </span><span class="lineNoCov">              0 :     s_log_impl().m_log_formatter-&gt;test_unit_start( s_log_impl().stream(), tu );</span>
<span class="lineNum">     179 </span>                : }
<span class="lineNum">     180 </span>                : 
<span class="lineNum">     181 </span>                : //____________________________________________________________________________//
<span class="lineNum">     182 </span>                : 
<span class="lineNum">     183 </span>                : void
<span class="lineNum">     184 </span><span class="lineCov">             13 : unit_test_log_t::test_unit_finish( test_unit const&amp; tu, unsigned long elapsed )</span>
<span class="lineNum">     185 </span>                : {
<span class="lineNum">     186 </span><span class="lineCov">             13 :     if( s_log_impl().m_threshold_level &gt; log_test_units )</span>
<span class="lineNum">     187 </span><span class="lineCov">             13 :         return;</span>
<span class="lineNum">     188 </span>                : 
<span class="lineNum">     189 </span><span class="lineNoCov">              0 :     s_log_impl().m_checkpoint_data.clear();</span>
<span class="lineNum">     190 </span>                : 
<span class="lineNum">     191 </span><span class="lineNoCov">              0 :     if( s_log_impl().m_entry_in_progress )</span>
<span class="lineNum">     192 </span><span class="lineNoCov">              0 :         *this &lt;&lt; log::end();</span>
<span class="lineNum">     193 </span>                : 
<span class="lineNum">     194 </span><span class="lineNoCov">              0 :     s_log_impl().m_log_formatter-&gt;test_unit_finish( s_log_impl().stream(), tu, elapsed );</span>
<span class="lineNum">     195 </span>                : }
<span class="lineNum">     196 </span>                : 
<span class="lineNum">     197 </span>                : //____________________________________________________________________________//
<span class="lineNum">     198 </span>                : 
<span class="lineNum">     199 </span>                : void
<span class="lineNum">     200 </span><span class="lineNoCov">              0 : unit_test_log_t::test_unit_skipped( test_unit const&amp; tu )</span>
<span class="lineNum">     201 </span>                : {
<span class="lineNum">     202 </span><span class="lineNoCov">              0 :     if( s_log_impl().m_threshold_level &gt; log_test_units )</span>
<span class="lineNum">     203 </span><span class="lineNoCov">              0 :         return;</span>
<span class="lineNum">     204 </span>                : 
<span class="lineNum">     205 </span><span class="lineNoCov">              0 :     if( s_log_impl().m_entry_in_progress )</span>
<span class="lineNum">     206 </span><span class="lineNoCov">              0 :         *this &lt;&lt; log::end();</span>
<span class="lineNum">     207 </span>                : 
<span class="lineNum">     208 </span><span class="lineNoCov">              0 :     s_log_impl().m_log_formatter-&gt;test_unit_skipped( s_log_impl().stream(), tu );</span>
<span class="lineNum">     209 </span>                : }
<span class="lineNum">     210 </span>                : 
<span class="lineNum">     211 </span>                : //____________________________________________________________________________//
<span class="lineNum">     212 </span>                : 
<span class="lineNum">     213 </span>                : void
<span class="lineNum">     214 </span><span class="lineNoCov">              0 : unit_test_log_t::test_unit_aborted( test_unit const&amp; )</span>
<span class="lineNum">     215 </span>                : {
<span class="lineNum">     216 </span>                :     // do nothing
<span class="lineNum">     217 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     218 </span>                : 
<span class="lineNum">     219 </span>                : //____________________________________________________________________________//
<span class="lineNum">     220 </span>                : 
<span class="lineNum">     221 </span>                : void
<span class="lineNum">     222 </span><span class="lineCov">             14 : unit_test_log_t::assertion_result( bool )</span>
<span class="lineNum">     223 </span>                : {
<span class="lineNum">     224 </span>                :     // do nothing
<span class="lineNum">     225 </span><span class="lineCov">             14 : }</span>
<span class="lineNum">     226 </span>                : 
<span class="lineNum">     227 </span>                : //____________________________________________________________________________//
<span class="lineNum">     228 </span>                : 
<span class="lineNum">     229 </span>                : void
<span class="lineNum">     230 </span><span class="lineNoCov">              0 : unit_test_log_t::exception_caught( execution_exception const&amp; ex )</span>
<span class="lineNum">     231 </span>                : {
<span class="lineNum">     232 </span>                :     log_level l =
<span class="lineNum">     233 </span>                :         ex.code() &lt;= execution_exception::cpp_exception_error   ? log_cpp_exception_errors :
<span class="lineNum">     234 </span>                :         (ex.code() &lt;= execution_exception::timeout_error        ? log_system_errors
<span class="lineNum">     235 </span><span class="lineNoCov">              0 :                                                                 : log_fatal_errors );</span>
<span class="lineNum">     236 </span>                : 
<span class="lineNum">     237 </span><span class="lineNoCov">              0 :     if( l &gt;= s_log_impl().m_threshold_level ) {</span>
<span class="lineNum">     238 </span><span class="lineNoCov">              0 :         if( s_log_impl().m_entry_in_progress )</span>
<span class="lineNum">     239 </span><span class="lineNoCov">              0 :             *this &lt;&lt; log::end();</span>
<span class="lineNum">     240 </span>                : 
<span class="lineNum">     241 </span><span class="lineNoCov">              0 :         s_log_impl().m_log_formatter-&gt;log_exception( s_log_impl().stream(), s_log_impl().m_checkpoint_data, ex.what() );</span>
<span class="lineNum">     242 </span>                :     }
<span class="lineNum">     243 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     244 </span>                : 
<span class="lineNum">     245 </span>                : //____________________________________________________________________________//
<span class="lineNum">     246 </span>                : 
<span class="lineNum">     247 </span>                : void
<span class="lineNum">     248 </span><span class="lineCov">             14 : unit_test_log_t::set_checkpoint( const_string file, std::size_t line_num, const_string msg )</span>
<span class="lineNum">     249 </span>                : {
<span class="lineNum">     250 </span><span class="lineCov">             14 :     s_log_impl().set_checkpoint( file, line_num, msg );</span>
<span class="lineNum">     251 </span><span class="lineCov">             14 : }</span>
<span class="lineNum">     252 </span>                : 
<span class="lineNum">     253 </span>                : //____________________________________________________________________________//
<span class="lineNum">     254 </span>                : 
<span class="lineNum">     255 </span>                : char
<span class="lineNum">     256 </span><span class="lineCov">            303 : set_unix_slash( char in )</span>
<span class="lineNum">     257 </span>                : {
<span class="lineNum">     258 </span><span class="lineCov">            303 :     return in == '\\' ? '/' : in;</span>
<span class="lineNum">     259 </span>                : }
<span class="lineNum">     260 </span>                :     
<span class="lineNum">     261 </span>                : unit_test_log_t&amp;
<span class="lineNum">     262 </span><span class="lineCov">             14 : unit_test_log_t::operator&lt;&lt;( log::begin const&amp; b )</span>
<span class="lineNum">     263 </span>                : {
<span class="lineNum">     264 </span><span class="lineCov">             14 :     if( s_log_impl().m_entry_in_progress )</span>
<span class="lineNum">     265 </span><span class="lineNoCov">              0 :         *this &lt;&lt; log::end();</span>
<span class="lineNum">     266 </span>                : 
<span class="lineNum">     267 </span><span class="lineCov">             14 :     s_log_impl().m_stream_state_saver-&gt;restore();</span>
<span class="lineNum">     268 </span>                : 
<span class="lineNum">     269 </span><span class="lineCov">             14 :     s_log_impl().m_entry_data.clear();</span>
<span class="lineNum">     270 </span>                : 
<span class="lineNum">     271 </span><span class="lineCov">             14 :     assign_op( s_log_impl().m_entry_data.m_file_name, b.m_file_name, 0 );</span>
<span class="lineNum">     272 </span>                : 
<span class="lineNum">     273 </span>                :     // normalize file name
<span class="lineNum">     274 </span>                :     std::transform( s_log_impl().m_entry_data.m_file_name.begin(), s_log_impl().m_entry_data.m_file_name.end(),
<span class="lineNum">     275 </span>                :                     s_log_impl().m_entry_data.m_file_name.begin(),
<span class="lineNum">     276 </span><span class="lineCov">             14 :                     &amp;set_unix_slash );</span>
<span class="lineNum">     277 </span>                : 
<span class="lineNum">     278 </span><span class="lineCov">             14 :     s_log_impl().m_entry_data.m_line_num = b.m_line_num;</span>
<span class="lineNum">     279 </span>                : 
<span class="lineNum">     280 </span><span class="lineCov">             14 :     return *this;</span>
<span class="lineNum">     281 </span>                : }
<span class="lineNum">     282 </span>                : 
<span class="lineNum">     283 </span>                : //____________________________________________________________________________//
<span class="lineNum">     284 </span>                : 
<span class="lineNum">     285 </span>                : unit_test_log_t&amp;
<span class="lineNum">     286 </span><span class="lineCov">             14 : unit_test_log_t::operator&lt;&lt;( log::end const&amp; )</span>
<span class="lineNum">     287 </span>                : {
<span class="lineNum">     288 </span><span class="lineCov">             14 :     if( s_log_impl().m_entry_in_progress )</span>
<span class="lineNum">     289 </span><span class="lineNoCov">              0 :         s_log_impl().m_log_formatter-&gt;log_entry_finish( s_log_impl().stream() );</span>
<span class="lineNum">     290 </span>                : 
<span class="lineNum">     291 </span><span class="lineCov">             14 :     s_log_impl().m_entry_in_progress = false;</span>
<span class="lineNum">     292 </span>                : 
<span class="lineNum">     293 </span><span class="lineCov">             14 :     return *this;</span>
<span class="lineNum">     294 </span>                : }
<span class="lineNum">     295 </span>                : 
<span class="lineNum">     296 </span>                : //____________________________________________________________________________//
<span class="lineNum">     297 </span>                : 
<span class="lineNum">     298 </span>                : unit_test_log_t&amp;
<span class="lineNum">     299 </span><span class="lineCov">             14 : unit_test_log_t::operator&lt;&lt;( log_level l )</span>
<span class="lineNum">     300 </span>                : {
<span class="lineNum">     301 </span><span class="lineCov">             14 :     s_log_impl().m_entry_data.m_level = l;</span>
<span class="lineNum">     302 </span>                : 
<span class="lineNum">     303 </span><span class="lineCov">             14 :     return *this;</span>
<span class="lineNum">     304 </span>                : }
<span class="lineNum">     305 </span>                : 
<span class="lineNum">     306 </span>                : //____________________________________________________________________________//
<span class="lineNum">     307 </span>                : 
<span class="lineNum">     308 </span>                : ut_detail::entry_value_collector
<span class="lineNum">     309 </span><span class="lineNoCov">              0 : unit_test_log_t::operator()( log_level l )</span>
<span class="lineNum">     310 </span>                : {
<span class="lineNum">     311 </span><span class="lineNoCov">              0 :     *this &lt;&lt; l;</span>
<span class="lineNum">     312 </span>                : 
<span class="lineNum">     313 </span><span class="lineNoCov">              0 :     return ut_detail::entry_value_collector();</span>
<span class="lineNum">     314 </span>                : }
<span class="lineNum">     315 </span>                : 
<span class="lineNum">     316 </span>                : //____________________________________________________________________________//
<span class="lineNum">     317 </span>                : 
<span class="lineNum">     318 </span>                : bool
<span class="lineNum">     319 </span><span class="lineNoCov">              0 : unit_test_log_t::log_entry_start()</span>
<span class="lineNum">     320 </span>                : {
<span class="lineNum">     321 </span><span class="lineNoCov">              0 :     if( s_log_impl().m_entry_in_progress ) </span>
<span class="lineNum">     322 </span><span class="lineNoCov">              0 :         return true;</span>
<span class="lineNum">     323 </span>                : 
<span class="lineNum">     324 </span><span class="lineNoCov">              0 :     switch( s_log_impl().m_entry_data.m_level ) {</span>
<span class="lineNum">     325 </span>                :     case log_successful_tests:
<span class="lineNum">     326 </span>                :         s_log_impl().m_log_formatter-&gt;log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
<span class="lineNum">     327 </span><span class="lineNoCov">              0 :                                                        unit_test_log_formatter::BOOST_UTL_ET_INFO );</span>
<span class="lineNum">     328 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     329 </span>                :     case log_messages:
<span class="lineNum">     330 </span>                :         s_log_impl().m_log_formatter-&gt;log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
<span class="lineNum">     331 </span><span class="lineNoCov">              0 :                                                        unit_test_log_formatter::BOOST_UTL_ET_MESSAGE );</span>
<span class="lineNum">     332 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     333 </span>                :     case log_warnings:
<span class="lineNum">     334 </span>                :         s_log_impl().m_log_formatter-&gt;log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
<span class="lineNum">     335 </span><span class="lineNoCov">              0 :                                                        unit_test_log_formatter::BOOST_UTL_ET_WARNING );</span>
<span class="lineNum">     336 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     337 </span>                :     case log_all_errors:
<span class="lineNum">     338 </span>                :     case log_cpp_exception_errors:
<span class="lineNum">     339 </span>                :     case log_system_errors:
<span class="lineNum">     340 </span>                :         s_log_impl().m_log_formatter-&gt;log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
<span class="lineNum">     341 </span><span class="lineNoCov">              0 :                                                        unit_test_log_formatter::BOOST_UTL_ET_ERROR );</span>
<span class="lineNum">     342 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     343 </span>                :     case log_fatal_errors:
<span class="lineNum">     344 </span>                :         s_log_impl().m_log_formatter-&gt;log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
<span class="lineNum">     345 </span><span class="lineNoCov">              0 :                                                        unit_test_log_formatter::BOOST_UTL_ET_FATAL_ERROR );</span>
<span class="lineNum">     346 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     347 </span>                :     case log_nothing:
<span class="lineNum">     348 </span>                :     case log_test_units:
<span class="lineNum">     349 </span>                :     case invalid_log_level:
<span class="lineNum">     350 </span><span class="lineNoCov">              0 :         return false;</span>
<span class="lineNum">     351 </span>                :     }
<span class="lineNum">     352 </span>                : 
<span class="lineNum">     353 </span><span class="lineNoCov">              0 :     s_log_impl().m_entry_in_progress = true;</span>
<span class="lineNum">     354 </span>                : 
<span class="lineNum">     355 </span><span class="lineNoCov">              0 :     return true;</span>
<span class="lineNum">     356 </span>                : }
<span class="lineNum">     357 </span>                : 
<span class="lineNum">     358 </span>                : //____________________________________________________________________________//
<span class="lineNum">     359 </span>                : 
<span class="lineNum">     360 </span>                : unit_test_log_t&amp;
<span class="lineNum">     361 </span><span class="lineCov">             28 : unit_test_log_t::operator&lt;&lt;( const_string value )</span>
<span class="lineNum">     362 </span>                : {
<span class="lineNum">     363 </span><span class="lineCov">             28 :     if( s_log_impl().m_entry_data.m_level &gt;= s_log_impl().m_threshold_level &amp;&amp; !value.empty() &amp;&amp; log_entry_start() )</span>
<span class="lineNum">     364 </span><span class="lineNoCov">              0 :         s_log_impl().m_log_formatter-&gt;log_entry_value( s_log_impl().stream(), value );</span>
<span class="lineNum">     365 </span>                : 
<span class="lineNum">     366 </span><span class="lineCov">             28 :     return *this;</span>
<span class="lineNum">     367 </span>                : }
<span class="lineNum">     368 </span>                : 
<span class="lineNum">     369 </span>                : //____________________________________________________________________________//
<span class="lineNum">     370 </span>                : 
<span class="lineNum">     371 </span>                : unit_test_log_t&amp;
<span class="lineNum">     372 </span><span class="lineCov">             14 : unit_test_log_t::operator&lt;&lt;( lazy_ostream const&amp; value )</span>
<span class="lineNum">     373 </span>                : {
<span class="lineNum">     374 </span><span class="lineCov">             14 :     if( s_log_impl().m_entry_data.m_level &gt;= s_log_impl().m_threshold_level &amp;&amp; !value.empty() &amp;&amp; log_entry_start() )</span>
<span class="lineNum">     375 </span><span class="lineNoCov">              0 :         s_log_impl().m_log_formatter-&gt;log_entry_value( s_log_impl().stream(), value );</span>
<span class="lineNum">     376 </span>                : 
<span class="lineNum">     377 </span><span class="lineCov">             14 :     return *this;</span>
<span class="lineNum">     378 </span>                : }
<span class="lineNum">     379 </span>                : 
<span class="lineNum">     380 </span>                : //____________________________________________________________________________//
<span class="lineNum">     381 </span>                : 
<span class="lineNum">     382 </span>                : void
<span class="lineNum">     383 </span><span class="lineNoCov">              0 : unit_test_log_t::set_stream( std::ostream&amp; str )</span>
<span class="lineNum">     384 </span>                : {
<span class="lineNum">     385 </span><span class="lineNoCov">              0 :     if( s_log_impl().m_entry_in_progress )</span>
<span class="lineNum">     386 </span><span class="lineNoCov">              0 :         return;</span>
<span class="lineNum">     387 </span>                : 
<span class="lineNum">     388 </span><span class="lineNoCov">              0 :     s_log_impl().m_stream = &amp;str;</span>
<span class="lineNum">     389 </span><span class="lineNoCov">              0 :     s_log_impl().m_stream_state_saver.reset( new io_saver_type( str ) );</span>
<span class="lineNum">     390 </span>                : }
<span class="lineNum">     391 </span>                : 
<span class="lineNum">     392 </span>                : //____________________________________________________________________________//
<span class="lineNum">     393 </span>                : 
<span class="lineNum">     394 </span>                : void
<span class="lineNum">     395 </span><span class="lineCov">              2 : unit_test_log_t::set_threshold_level( log_level lev )</span>
<span class="lineNum">     396 </span>                : {
<span class="lineNum">     397 </span><span class="lineCov">              2 :     if( s_log_impl().m_entry_in_progress || lev == invalid_log_level )</span>
<span class="lineNum">     398 </span><span class="lineCov">              2 :         return;</span>
<span class="lineNum">     399 </span>                : 
<span class="lineNum">     400 </span><span class="lineNoCov">              0 :     s_log_impl().m_threshold_level = lev;</span>
<span class="lineNum">     401 </span>                : }
<span class="lineNum">     402 </span>                : 
<span class="lineNum">     403 </span>                : //____________________________________________________________________________//
<span class="lineNum">     404 </span>                : 
<span class="lineNum">     405 </span>                : void
<span class="lineNum">     406 </span><span class="lineCov">              2 : unit_test_log_t::set_format( output_format log_format )</span>
<span class="lineNum">     407 </span>                : {
<span class="lineNum">     408 </span><span class="lineCov">              2 :     if( s_log_impl().m_entry_in_progress )</span>
<span class="lineNum">     409 </span><span class="lineNoCov">              0 :         return;</span>
<span class="lineNum">     410 </span>                : 
<span class="lineNum">     411 </span><span class="lineCov">              2 :     if( log_format == CLF )</span>
<span class="lineNum">     412 </span><span class="lineCov">              2 :         set_formatter( new output::compiler_log_formatter );</span>
<span class="lineNum">     413 </span>                :     else
<span class="lineNum">     414 </span><span class="lineNoCov">              0 :         set_formatter( new output::xml_log_formatter );</span>
<span class="lineNum">     415 </span>                : }
<span class="lineNum">     416 </span>                : 
<span class="lineNum">     417 </span>                : //____________________________________________________________________________//
<span class="lineNum">     418 </span>                : 
<span class="lineNum">     419 </span>                : void
<span class="lineNum">     420 </span><span class="lineCov">              2 : unit_test_log_t::set_formatter( unit_test_log_formatter* the_formatter )</span>
<span class="lineNum">     421 </span>                : {
<span class="lineNum">     422 </span><span class="lineCov">              2 :     s_log_impl().m_log_formatter.reset( the_formatter );</span>
<span class="lineNum">     423 </span><span class="lineCov">              2 : }</span>
<span class="lineNum">     424 </span>                : 
<span class="lineNum">     425 </span>                : //____________________________________________________________________________//
<span class="lineNum">     426 </span>                : 
<span class="lineNum">     427 </span>                : // ************************************************************************** //
<span class="lineNum">     428 </span>                : // **************            unit_test_log_formatter           ************** //
<span class="lineNum">     429 </span>                : // ************************************************************************** //
<span class="lineNum">     430 </span>                : 
<span class="lineNum">     431 </span>                : void
<span class="lineNum">     432 </span><span class="lineNoCov">              0 : unit_test_log_formatter::log_entry_value( std::ostream&amp; ostr, lazy_ostream const&amp; value )</span>
<span class="lineNum">     433 </span>                : {
<span class="lineNum">     434 </span><span class="lineNoCov">              0 :     log_entry_value( ostr, (wrap_stringstream().ref() &lt;&lt; value).str() );</span>
<span class="lineNum">     435 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     436 </span>                : 
<span class="lineNum">     437 </span>                : //____________________________________________________________________________//
<span class="lineNum">     438 </span>                : 
<span class="lineNum">     439 </span>                : } // namespace unit_test
<span class="lineNum">     440 </span>                : 
<span class="lineNum">     441 </span>                : } // namespace boost
<span class="lineNum">     442 </span>                : 
<span class="lineNum">     443 </span>                : //____________________________________________________________________________//
<span class="lineNum">     444 </span>                : 
<span class="lineNum">     445 </span>                : #include &lt;boost/test/detail/enable_warnings.hpp&gt;
<span class="lineNum">     446 </span>                : 
<span class="lineNum">     447 </span>                : #endif // BOOST_TEST_UNIT_TEST_LOG_IPP_012205GER
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
